package com.luoc;


import com.luoc.entity.Aa08;
import org.apache.ibatis.io.Resources;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;

import java.io.IOException;
import java.io.InputStream;

/**
 * @author luoc
 * @version 1.0
 * @date 2020/9/29 15:57
 * @since 1.0
 */
public class mybatisTest {

    public static void main(String[] args) throws IOException {
        String resource = "mybatis-spring.xml";
        InputStream inputStream = Resources.getResourceAsStream(resource);
        SqlSessionFactory sqlSessionFactory = new SqlSessionFactoryBuilder().build(inputStream);
        SqlSession session = sqlSessionFactory.openSession();
        Aa08 aa08 = null;
        try {
             aa08 = session.selectOne("com.luoc.mapper.Aa08Mapper.selectOne", "1");
            System.out.println(aa08.getAaa008());
        } finally {
            session.close();
        }

    }
}
